// packageG/mycomponent/newAuction/newAuction.js
const app = getApp();
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    datas: {
      type: null
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },
  lifetimes: {
    attached() {
      this.getData();
      let language = wx.getStorageSync("langIndex");
      let nowTime = new Date().getTime()
      this.setData({
        language: language.en,
        nowTime: nowTime
      });
    }
  },
  /**
   * 组件的方法列表
   */
  methods: {
    tapDetail(e) {
      let {
        item
      } = e.currentTarget.dataset;
      wx.navigateTo({
        url: '/mircoApp/new-auction/new_auction_detail/new_auction_detail?id=' + item.id,
      })
    },
    async getData() {
      let ids = [];
      ids = this.data.datas.list.map((item) => {
        return item.id
      })
      let {
        data
      } = await app._postNetWork({
        url: app.getNetAddresss("plugin.new-auction.frontend.activity"),
        data: {
          activity_ids: ids
        }
      })
      if (data.result) {
        this.setData({
          good_list: data.data
        })
      } else {
        app.tips(data.msg)
      }
    }
  }
})